﻿using System.Collections.Generic;
using System.ComponentModel;

namespace DataInterface
{
    public interface IDataTransmissionConfig
    {
        /// <summary>
        /// 名称
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        bool Enabled { get; set; }

        /// <summary>
        /// 传输数据的格式
        /// </summary>
        TransmissionDataFormat TransmissionDataFormat { get; set; }

        /// <summary>
        /// 是否重试发送失败数据
        /// </summary>
        bool ReTry { get; set; }

        /// <summary>
        /// 完全重试失败的数据是否保留
        /// </summary>
        bool FaultDataRetention { get; set; }

        /// <summary>
        /// 重试次数
        /// </summary>
        int ReTryCount { get; set; }

        /// <summary>
        /// 重试间隔(秒)
        /// </summary>
        int ReTyrInterval { get; set; }

        string Message { get; set; }

        bool Valided();

        /// <summary>
        /// 判断是否已经被包含再集合中
        /// </summary>
        /// <returns></returns>
        bool BeIncluded(IList<IDataTransmissionConfig> collecion, ref int index);
    }

    public enum TransmissionDataFormat
    {
        [Description("原始数据")]
        RawData,
        [Description("处理过的数据")]
        ProcessedData
    }
}
